//
// Created by Tony on 2024/1/14.
//

#ifndef PARSER_AST_LIST_H
#define PARSER_AST_LIST_H

#include "Ast.h"

namespace Parser {

class AstList : public Ast {
protected:
    vector<shared_ptr<Ast>> children;

public:
    explicit AstList(const vector<shared_ptr<Ast>>& children) : children(children) {}

    size_t numChildren() override { return children.size(); }

    vector<shared_ptr<Ast>> getChildren() override { return children; }

    shared_ptr<Ast> child(int index) override { return children[index]; }

    Lexer::Position position() override { return children[0]->position(); }
};

} // namespace Parser

#endif // PARSER_AST_LIST_H
